home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-11-08 | 4.7 KB | 173 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWInk.h
- // Release Version: $ 1.0d11 $
- //
- // Copyright: © 1993, 1995 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWINK_H
- #define FWINK_H
-
- #ifndef FWGROBJ_H
- #include "FWGrObj.h"
- #endif
-
- #ifndef FWGRGLOB_H
- #include "FWGrGlob.h"
- #endif
-
- #ifndef FWGCONST_H
- #include "FWGConst.h"
- #endif
-
- #ifndef FWCOLOR_H
- #include "FWColor.h"
- #endif
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export on
- #endif
-
- //========================================================================================
- // Forward Class Declarations
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CInkRep;
-
- //========================================================================================
- // CLASS FW_PInk
- //========================================================================================
-
- class FW_CLASS_ATTR FW_PInk : public FW_CGraphicCountedPtr
- {
- public:
- FW_DECLARE_CLASS
-
- public:
- FW_PInk();
- virtual ~ FW_PInk();
-
- FW_PInk(const FW_CColor& foreColor,
- const FW_CColor& backColor = FW_kRGBWhite,
- FW_TransferModes tranferMode = FW_kCopy);
- FW_PInk(FW_TransferModes tranferMode);
-
- FW_PInk(const FW_PInk& other);
- FW_PInk& operator=(const FW_PInk& other);
-
- FW_PInk(FW_EStandardInks std);
- FW_PInk& operator=(FW_EStandardInks std);
-
- FW_CInkRep* operator->();
- const FW_CInkRep* operator->() const;
- };
-
- //----------------------------------------------------------------------------------------
- // FW_PInk::operator->
- //----------------------------------------------------------------------------------------
- inline FW_CInkRep* FW_PInk::operator->()
- {
- return (FW_CInkRep*)GetRep();
- }
-
- //----------------------------------------------------------------------------------------
- // FW_PInk::operator->
- //----------------------------------------------------------------------------------------
- inline const FW_CInkRep* FW_PInk::operator->() const
- {
- return (const FW_CInkRep*)GetRep();
- }
-
- //========================================================================================
- // class FW_CInkRep
- //========================================================================================
-
- class FW_CLASS_ATTR FW_CInkRep : public FW_CGraphicCountedPtrRep
- {
- friend class FW_CLASS_ATTR FW_PInk;
-
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- FW_CInkRep();
- FW_CInkRep(const FW_CColor& foreColor, const FW_CColor& backColor, FW_TransferModes transferMode);
- FW_CInkRep(const FW_CInkRep& otherRep);
- FW_CInkRep(FW_CReadableStream& archive);
-
- FW_CInkRep& operator=(const FW_CInkRep& otherRep);
-
- virtual ~FW_CInkRep();
-
- //----------------------------------------------------------------------------------------
- // Memory management
- //
- public:
- void* operator new(size_t size);
- void operator delete(void* p);
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void Flatten(FW_CWritableStream& archive) const;
-
- virtual FW_Boolean IsEqual(const FW_CGraphicCountedPtrRep* other) const;
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- // ----- Copying -----
- FW_PInk Copy() const;
-
- // ----- Archiving -----
- static void* Read(FW_CReadableStream& archive);
-
- // ----- Accessors -----
- void SetForeColor(const FW_CColor& foreColor)
- {fForeColor = foreColor;}
- void GetForeColor(FW_CColor& foreColor) const
- {foreColor = fForeColor;}
- const FW_CColor* GetForeColor() const
- {return &fForeColor;}
-
- void SetBackColor(const FW_CColor& backColor)
- {fBackColor = backColor;}
- void GetBackColor(FW_CColor& backColor) const
- {backColor = fBackColor;}
- const FW_CColor* GetBackColor() const
- {return &fBackColor;}
-
- void SetTransferMode(FW_TransferModes transferMode)
- {fTransferMode = transferMode;}
- FW_TransferModes GetTransferMode() const
- {return fTransferMode;}
-
- //----------------------------------------------------------------------------------------
- // Public but for internal use only
- //
- public:
- FW_Boolean PrivSpecialTransferMode() const
- {return fTransferMode == FW_kInvert || fTransferMode == FW_kErase;}
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CColor fForeColor;
- FW_CColor fBackColor;
- FW_TransferModes fTransferMode;
- };
-
- #if FW_LIB_EXPORT_PRAGMAS
- #pragma lib_export off
- #endif
-
- #endif
-